package com.usian.controller;

import com.usian.pojo.TbItemParam;
import com.usian.service.ItemParamService;
import com.usian.utils.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/service/itemParam")
public class TbItemParamController {

    @Autowired
    private ItemParamService itemParamService;

    @RequestMapping("/selectItemParamByItemCatId")
    public TbItemParam selectItemParamByItemCatId(@RequestParam Long itemCatId){
        return itemParamService.selectItemParamByItemCatId(itemCatId);
    }
    @RequestMapping("/selectItemParamAll")
    public PageResult selectItemParamAll(@RequestParam Integer page, @RequestParam Integer rows){
        return itemParamService.selectItemParamAll(page,rows);
    }

    /**
     * @param itemCatId
     * @param paramData
     * @return
     */
    @RequestMapping("insertItemParam")
    public Integer insertItemParam(@RequestParam Integer itemCatId,@RequestParam String paramData){
        return itemParamService.insertItemParam(itemCatId,paramData);
    }

    /**
     * @param id
     * @return
     */
    @RequestMapping("/deleteItemParamById")
    public Integer deleteItemParamById(@RequestParam Integer id){
        return itemParamService.deleteItemParamById(id);
    }
}
